The Handbrake works in a very similar manner to brakes on a bicycle.
As pressure is put on the cable (pulling up the handbrake)
It moves the rear brake pads on to the brake discs or drums.
The handbrake lever has a ratchet system that you would hear if you did not press the button on the end of the brake lever whilst lifting it.
Usually on most vehicles the handbrake will only require about 4-6 clicks on the ratchet before the car comes to a complete stop.
If you ever get to the stage where the handbrake has been applied to its maximum height and the vehicle still rolls, then it is highly likely that either the handbrake cable needs adjusting or renewing, or there may be an issue inside the brake mechanism at the wheels, it is highly advised that you seek professional advice to rectify the problem.
The handbrake DOES NOT make the rear brake lights illuminate, so never bring the car to a stop by using it. It could also cause your vehicle to go into a skid should they be applied at speed.
However, in the event of a footbrake failure it may be safer to apply the parking brake and get some form of braking than nothing at all.